package bsi.vn.FirstApp;

import bsi.vn.Lib.ProcessFunc;
import android.os.Bundle;
import android.app.Activity;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.TextView;
import android.annotation.TargetApi;
import android.content.Intent;
import android.os.Build;

public class InformationActivity extends Activity {
	private Intent intent;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_information);
		// Show the Up button in the action bar.
		//setupActionBar();
		
		String myEmail = getResources().getString(R.string.iftvSupport);
		TextView tvEmail = (TextView)findViewById(R.id.iftvSupport);
		tvEmail.setText(Html.fromHtml("<a href=\"mailto:"+ myEmail +"\">"+ myEmail +"</a>"));
		tvEmail.setMovementMethod(LinkMovementMethod.getInstance());
		
		String myWebsite = getResources().getString(R.string.iftvWebsite);
		TextView tvWebsite = (TextView)findViewById(R.id.iftvWebsite);
		tvWebsite.setText(Html.fromHtml("<a href=\""+ myWebsite +"\">"+ myWebsite +"</a>"));
		tvWebsite.setMovementMethod(LinkMovementMethod.getInstance());
	}

	/**
	 * Set up the {@link android.app.ActionBar}, if the API is available.
	 */
//	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
//	private void setupActionBar() {
//		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
//			getActionBar().setDisplayHomeAsUpEnabled(true);
//		}
//	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		 MenuInflater menuInflater = getMenuInflater();
	        menuInflater.inflate(R.menu.atmsearch, menu);
		return super.onCreateOptionsMenu(menu);
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		if(item.getItemId() != R.id.menu_sub && item.getItemId() != R.id.menu_information){
			startActivity(ProcessFunc.MenuAction(this, item));
		}
		return true;
	}

}
